package cn.zust.itcost.controller;

import cn.zust.itcost.service.ResumeAnalysisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Api(tags = "简历分析接口")
@RestController
@RequestMapping("/api/resume/analysis")
public class ResumeAnalysisController {

    @Autowired
    private ResumeAnalysisService resumeAnalysisService;

    @ApiOperation("分析简历并提供改进建议")
    @GetMapping("/{resumeId}")
    public ResponseEntity<Map<String, Object>> analyzeResume(@PathVariable Long resumeId) {
        return ResponseEntity.ok(resumeAnalysisService.analyzeResume(resumeId));
    }

    @ApiOperation("获取简历评分")
    @GetMapping("/{resumeId}/score")
    public ResponseEntity<Map<String, Object>> scoreResume(@PathVariable Long resumeId) {
        return ResponseEntity.ok(resumeAnalysisService.scoreResume(resumeId));
    }

    @ApiOperation("分析简历关键词")
    @GetMapping("/{resumeId}/keywords")
    public ResponseEntity<Map<String, Object>> analyzeKeywords(@PathVariable Long resumeId) {
        return ResponseEntity.ok(resumeAnalysisService.analyzeKeywords(resumeId));
    }
} 